<?php
//创建计划任务
# crontab -e
# 0 */0 * * * /usr/bin/php /root/test.php

// test.php的代码
$redis = new Redis();
$redis->connect('127.0.0.1', 6379);
$redis->auth('123456');

$order_total_price = $redis->get('order_total_price_today');
$order_total = $redis->get('order_total_today');
$new_user_total = $redis->get('new_user_total');
$order_user_total = $redis->get('order_user_total');

//销售额(元)
$redis->set('order_total_price_yesterday',$order_total_price);
$redis->set('order_total_price_today',0);

//支付订单数
$redis->set('order_total_yesterday',$order_total);
$redis->set('order_total_today',0);

//新增用户数
$redis->set('new_user_yesterday',$new_user_total);
$redis->set('new_user_total',0);

//下单用户数
$redis->set('order_user_yesterday',$order_user_total);
$redis->set('order_user_total',0);
